<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">

<head>
<title th:text="${@thCxt.param('sys_title')}"></title>
<meta charset="utf-8" />
<meta name="keywords" content="MyClouds" />
<meta name="author" content="xiongchun" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="/theme/assets/skin/default_skin/css/theme.css" />
<link rel="stylesheet" type="text/css" href="/theme/assets/admin-tools/admin-forms/css/admin-forms.css" />
<link rel="stylesheet" type="text/css" href="/css/myclouds.css" />
<link rel="shortcut icon" href="/theme/assets/img/favicon.ico" />
<script type="text/javascript" src="/theme/vendor/jquery/jquery-1.11.1.min.js"></script>
</head>

<body class="external-page sb-l-c sb-r-c">
	<!--/* 公共代码 */-->
	<div th:replace="fragments/common"></div>
	<!-- Start: Main -->
	<div id="main" class="animated fadeIn">

		<!-- Start: Content-Wrapper -->
		<section id="content_wrapper">

			<!-- begin canvas animation bg -->
			<div id="canvas-wrapper">
				<canvas id="login-canvas"></canvas>
			</div>

			<!-- Begin: Content -->
			<section id="content">

				<div class="admin-form theme-info animated fadeInDown">

					<div class="panel panel-info mt10 br-n">


						<!-- end .form-header section -->
						<form id="fo_login">
							<div class="panel-body bg-light p30">
								<div class="row">
									<div class="col-sm-6 pr30">

										<div class="section">
											<label for="account" class="field-label text-muted mb10 fs15">账号</label>
											<label for="account" class="field prepend-icon">
												<input type="text" name="account" id="account" class="gui-input" placeholder="请输入登录账号" />
												<label for="account" class="field-icon">
													<i class="fa fa-user"></i>
												</label>
											</label>
										</div>
										<!-- end section -->

										<div class="section">
											<label for="account" class="field-label text-muted mb10 fs15">密码</label>
											<label for="password" class="field prepend-icon">
												<input type="password" name="password" id="password" class="gui-input" placeholder="请输入密码" />
												<label for="password" class="field-icon">
													<i class="fa fa-lock"></i>
												</label>
											</label>
										</div>
										<!-- end section -->
									</div>
									
									<div class="col-sm-6 br-l br-grey pl30">
									    
										<h2 class="mb20 text-center ls2"><span th:text="${#strings.abbreviate(@thCxt.param('sys_title_login'),15)}"></span></h2>
										<div class="text-center">
										       <img alt="" src="/img/logo.gif" width="120" height="120" />
										</div>
									</div>
								</div>
							</div>
							<!-- end .form-body section -->
							<div class="panel-footer clearfix p10 ph15">
								<button id="btn-login" type="button" class="btn btn-primary pull-right ph15">登录</button>
								<label class="switch ib switch-primary pull-left input-align mt10">
									<input type="checkbox" name="remember" id="remember" checked="true" />
									<label for="remember" data-on="是" data-off="否"></label>
									<span>记住我</span>
								</label>
							</div>
							<!-- end .form-footer section -->
						</form>
					</div>
				</div>

			</section>
			<!-- End: Content -->

		</section>
		<!-- End: Content-Wrapper -->

	</div>
	<!-- End: Main -->
	
	<!-- BEGIN: PAGE SCRIPTS -->
	<script src="/theme/assets/js/utility/utility.js"></script>
	<script src="/theme/assets/js/main.js"></script>
	<script src="/theme/assets/admin-tools/admin-forms/js/jquery.validate.min.js"></script>
	<script src="/js/md5.js"></script>
	<script src="/js/myclouds.js"></script>
	<!-- END: PAGE SCRIPTS -->

	<!-- CanvasBG Plugin(creates mousehover effect) -->
	<script src="/theme/vendor/plugins/canvasbg/canvasbg.js"></script>
	<script type="text/javascript">
		$(function() {
			"use strict";
			Core.init();
			
			$("#btn-login").on("click", fnLogin);

			// Init CanvasBG and pass target starting location
			CanvasBG.init({
				Loc : {
					x : window.innerWidth / 2,
					y : window.innerHeight / 3.3
				},
			});
			
			//响应回车键
			$(document).keydown(function(event){
			　　if(event.keyCode==13){
			　　		fnLogin();
			　　}
			});
			
			//登录请求
			function fnLogin() {
				var data = My.params('#fo_login');
				data.password = hex_md5(data.password);
				$.ajax({
					type : 'post',
					url : '/login/go',
					data : data,
					success : function(data) {
						if (data.code == '1') {
							window.location.href = './';
						} else {
							My.alert(data.msg);
						}
					}
				});
			}

		});


	</script>

</body>

</html>
